import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '日期',
    align:"center",
    dataIndex: 'date'
   },
   {
    title: '门店ID',
    align:"center",
    dataIndex: 'storeId'
   },
   {
    title: '门店编码',
    align:"center",
    dataIndex: 'storeCode'
   },
   {
    title: '门店名称',
    align:"center",
    dataIndex: 'storeName'
   },
   
   {
    title: '订单数',
    align:"center",
    dataIndex: 'orderNumber'
   },
   {
    title: '商家评分得分',
    align:"center",
    dataIndex: 'storeStoreStore'
   },
   {
    title: '收入',
    align:"center",
    dataIndex: 'income'
   },
   {
    title: '营业额',
    align:"center",
    dataIndex: 'turnover'
   },
   {
    title: '活动补贴',
    align:"center",
    dataIndex: 'subsity'
   },
   {
    title: '顾客实付',
    align:"center",
    dataIndex: 'actualPay'
   },
   {
    title: '有效订单',
    align:"center",
    dataIndex: 'effectiveOrder'
   },
   {
    title: '实付单均价',
    align:"center",
    dataIndex: 'actualPayAvg'
   },
   {
    title: '曝光人数',
    align:"center",
    dataIndex: 'exposeCustomer'
   },
   {
    title: '入店人数',
    align:"center",
    dataIndex: 'visitCustomerNumber'
   },
   {
    title: '入店转化率',
    align:"center",
    dataIndex: 'visitRate'
   },
   {
    title: '下单转化率',
    align:"center",
    dataIndex: 'buyRate'
   },
   {
    title: '推广花费',
    align:"center",
    dataIndex: 'pricePopularize'
   },
   {
    title: '曝光提升数',
    align:"center",
    dataIndex: 'exposeUp'
   },
   {
    title: '进店提升数',
    align:"center",
    dataIndex: 'visitUp'
   },
   {
    title: '推广进店率',
    align:"center",
    dataIndex: 'popularizeVisitRate'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "门店ID",
      field: 'storeId',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "门店编码",
      field: 'storeCode',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "门店名称",
      field: 'storeName',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "日期",
      field: 'date',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '门店ID',
    field: 'storeId',
    component: 'Input',
  },
  {
    label: '门店编码',
    field: 'storeCode',
    component: 'Input',
  },
  {
    label: '门店名称',
    field: 'storeName',
    component: 'Input',
  },
  {
    label: '日期',
    field: 'date',
    component: 'Input',
  },
  {
    label: '订单数',
    field: 'orderNumber',
    component: 'InputNumber',
  },
  {
    label: '商家评分得分',
    field: 'storeStoreStore',
    component: 'InputNumber',
  },
  {
    label: '收入',
    field: 'income',
    component: 'InputNumber',
  },
  {
    label: '营业额',
    field: 'turnover',
    component: 'InputNumber',
  },
  {
    label: '活动补贴',
    field: 'subsity',
    component: 'InputNumber',
  },
  {
    label: '顾客实付',
    field: 'actualPay',
    component: 'InputNumber',
  },
  {
    label: '有效订单',
    field: 'effectiveOrder',
    component: 'InputNumber',
  },
  {
    label: '实付单均价',
    field: 'actualPayAvg',
    component: 'InputNumber',
  },
  {
    label: '曝光人数',
    field: 'exposeCustomer',
    component: 'InputNumber',
  },
  {
    label: '入店人数',
    field: 'visitCustomerNumber',
    component: 'InputNumber',
  },
  {
    label: '入店转化率',
    field: 'visitRate',
    component: 'InputNumber',
  },
  {
    label: '下单转化率',
    field: 'buyRate',
    component: 'InputNumber',
  },
  {
    label: '推广花费',
    field: 'pricePopularize',
    component: 'InputNumber',
  },
  {
    label: '曝光提升数',
    field: 'exposeUp',
    component: 'InputNumber',
  },
  {
    label: '进店提升数',
    field: 'visitUp',
    component: 'InputNumber',
  },
  {
    label: '推广进店率',
    field: 'popularizeVisitRate',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  storeId: {title: '门店ID',order: 0,view: 'text', type: 'string',},
  storeCode: {title: '门店编码',order: 1,view: 'text', type: 'string',},
  storeName: {title: '门店名称',order: 2,view: 'text', type: 'string',},
  date: {title: '日期',order: 3,view: 'text', type: 'string',},
  orderNumber: {title: '订单数',order: 4,view: 'number', type: 'number',},
  storeStoreStore: {title: '商家评分得分',order: 5,view: 'number', type: 'number',},
  income: {title: '收入',order: 6,view: 'number', type: 'number',},
  turnover: {title: '营业额',order: 7,view: 'number', type: 'number',},
  subsity: {title: '活动补贴',order: 8,view: 'number', type: 'number',},
  actualPay: {title: '顾客实付',order: 9,view: 'number', type: 'number',},
  effectiveOrder: {title: '有效订单',order: 10,view: 'number', type: 'number',},
  actualPayAvg: {title: '实付单均价',order: 11,view: 'number', type: 'number',},
  exposeCustomer: {title: '曝光人数',order: 12,view: 'number', type: 'number',},
  visitCustomerNumber: {title: '入店人数',order: 13,view: 'number', type: 'number',},
  visitRate: {title: '入店转化率',order: 14,view: 'number', type: 'number',},
  buyRate: {title: '下单转化率',order: 15,view: 'number', type: 'number',},
  pricePopularize: {title: '推广花费',order: 16,view: 'number', type: 'number',},
  exposeUp: {title: '曝光提升数',order: 17,view: 'number', type: 'number',},
  visitUp: {title: '进店提升数',order: 18,view: 'number', type: 'number',},
  popularizeVisitRate: {title: '推广进店率',order: 19,view: 'number', type: 'number',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}